<template>
    <div>
        <div class="flex items-center justify-center">
            <div v-for="item in items" :key="item.value" class="m-5 " @click="hChange(item)">
                <label>{{ item.label }}</label> <input type="radio" :name="'item' + idx" :value="item.value"
                    :checked="item.value == props.modelValue" />
            </div>
        </div>
    </div>
</template>
<script setup>
const items = ref([
    { label: "正确", value: "yes" },
    { label: "错误", value: "no" }
])
const emit = defineEmits(['update:modelValue'])

const props = defineProps({
    idx: {
        type: String,
        default: ""
    },
    modelValue: {
        type: [Number, String],
        required: true
    }
})
const hChange = (item) => {
    emit('update:modelValue', item.value)
}
</script>